package cn.fay.chapter11;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Stack;

public class Test14 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		LinkedList<Integer> list1=new LinkedList<Integer>(Arrays.asList(0,1,2,3,4,5,6,7,8,9));
		LinkedList<Integer> list2=new LinkedList<Integer>();
		ListIterator<Integer> iterator=list1.listIterator();
		while (iterator.hasNext()) {
			list2.add(list2.size()/2, iterator.next());
		}
		System.out.println(list2);
		
	}

}
